$(document).ready(init);

function init() {
	showContent({
		ismyself : 'no'
	});
	
	$('#search').click(doSearch);
}

function doSearch() {
	showContent({
		startTime : $.trim($('#startTime').val()),
		endTime : $.trim($('#endTime').val())
	});
}

/**
 * 显示信息
 */
function showContent(queryParams) {
	$('#Consumeinfo').datagrid({
	    title:'',
	    iconCls:'icon-save',
	    singleSelect:true,
	    url:'consumeinfo-admin!queryConsumeinfos.action',
	    idField: 'id',
	    queryParams :queryParams,
	    showFooter:true,
	    nowrap:true,
	    columns:[[
	        {field:'empName',title:'姓名',width:fixWidth(0.08)},
	        {field:'cardNo',title:'卡号',width:fixWidth(0.08)},
	        {field:'deptName',title:'机构名称',width:fixWidth(0.08)},
	        {field:'devName',title:'设备名称',width:fixWidth(0.08)},
	        {field:'consumetime',title:'消费时间',width:fixWidth(0.15)},
	        {field:'setupcharges',title:'开机费(元)',width:fixWidth(0.08),align:'center'},
	        {field:'fine',title:'罚款金额(元)',width:fixWidth(0.1),align:'center'},
	        {field:'monetary', title:'消费金额(元)',width:fixWidth(0.1),align:'center'},
			{field:'nousemoney',title:'未使用罚款(元)',width:fixWidth(0.12),align:'center'},
	        {field:'othersmoney',title:'其它金额(元)',width:fixWidth(0.1),align:'center'},
			{field:'totalmoney', title:'消费累计(元)', width:fixWidth(0.2)}
	    ]],
	    pagination:true,
	    rownumbers:true,
	    fitColumns:true
	});
}